package ch.netcetera.planningpoker.shared.locator;

import com.google.web.bindery.requestfactory.shared.ServiceLocator;

/**
 * Stupid, generic ServiceLocator.
 * 
 * Taken from
 * http://turbomanage.wordpress.com/2011/03/25/using-gwt-requestfactory
 * -with-objectify/
 */
public class DaoServiceLocator implements ServiceLocator {
    public Object getInstance(Class<?> clazz) {
        try {
            return clazz.newInstance();
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
}
